UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yUqZchb7oBrHhfRv5Cr7FCXPYxGjlUPlcpr+kk26HfA='
WHERE
key_id = '3538300fcdfef9967a0ae8db45adb9b5e9584af943ea7f68e72b14dbbc47fc95'
AND (
token = 'yUqZchb7oBrHhfRv5Cr7FCXPYxGjlUPlcpr+kk26HfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)