UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYWTCbz4efG84KkUHtJ4ag/q63Jv96Dolic2qoQX1Y0='
WHERE
key_id = '6edaf23559431c616b838d4bb5fdd5b938020790e5d725760f611c6cc4a6fb82'
AND (
token = 'JYWTCbz4efG84KkUHtJ4ag/q63Jv96Dolic2qoQX1Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)