UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tVdBk324CZFLA/o+Rhqk7nO4Om+Kk1vPfCgaDJBzAOU='
WHERE
key_id = 'af11caf6ef92ead3d32db7494a97e5b4520ec8fefd2700cfe1d4696d9ae754c8'
AND (
token = 'tVdBk324CZFLA/o+Rhqk7nO4Om+Kk1vPfCgaDJBzAOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)