UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EcPVe87L1PeV8kI7k6tOXB72oJMFzY6OzuxKK5YoN/8='
WHERE
key_id = 'ac4b85ae8fe8986d674421791b374139108ea91d6754bec7cd55babcdfd438f2'
AND (
token = 'EcPVe87L1PeV8kI7k6tOXB72oJMFzY6OzuxKK5YoN/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)