UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+/+LYMatucG/yYMJi6kKiaTQZcxRiHvCunSh/u3eho='
WHERE
key_id = '577e1fd3e0c08e8eeefa2c2aa86b3101b3992b808265f064488016b819923735'
AND (
token = 'M+/+LYMatucG/yYMJi6kKiaTQZcxRiHvCunSh/u3eho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)