UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fwbfHyk6f93kQHwRMJaRuBump4mzbPAj/Z/1I8Ujac='
WHERE
key_id = '90a416902dce35f743e1beecd35d122043e0099025f122a94a8aa8f738dd2de4'
AND (
token = '3fwbfHyk6f93kQHwRMJaRuBump4mzbPAj/Z/1I8Ujac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)