UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bd6g7ArmMkYWWneiGVESNVNICDs7xE/J/4KuUWHWkC8='
WHERE
key_id = '0355adbb43f72c1787d47d913505684643a41091e7e098815bf4d5a3cb680862'
AND (
token = 'bd6g7ArmMkYWWneiGVESNVNICDs7xE/J/4KuUWHWkC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)