UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NZCf0EQ4FNEjSEqjfF0L7n8NRy3w21gKHP/2Fa46roE='
WHERE
key_id = '990390e0e305238ad6091db09e0179a89f2f4967c6d097410bfd437ed98e6bdd'
AND (
token = 'NZCf0EQ4FNEjSEqjfF0L7n8NRy3w21gKHP/2Fa46roE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)