UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeernjvXSqBi98hXhV7H45/NXtFmH/fyCshIvZE9vyI='
WHERE
key_id = 'c564aecc788f779ec3fa065c72dc6c222197b76c62f3706080cbae23ae9d7983'
AND (
token = 'EeernjvXSqBi98hXhV7H45/NXtFmH/fyCshIvZE9vyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)