UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Tf3AY0uHFVtGplkHBmSVvwG3jQcA9kqY/NKXK13WD8='
WHERE
key_id = '412b8f4cee87684615818820a4900c4979404857357af615e071b4bcfa2c11cf'
AND (
token = '6Tf3AY0uHFVtGplkHBmSVvwG3jQcA9kqY/NKXK13WD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)