UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KqPXJMr2MOS2o6KmysRMR9IwFPIeDWWWXciFLt/oaes='
WHERE
key_id = 'ee9f40cc4c4adfe68bd7d2952873f583a97ca2b0c3d279bd19698158e168d7fb'
AND (
token = 'KqPXJMr2MOS2o6KmysRMR9IwFPIeDWWWXciFLt/oaes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)