UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K6BZOfLYG1BG/UKhjhgAGFWq9sgSnvS1sYEBi2qk81U='
WHERE
key_id = '0a3abcc979a1e1d8af682245954077bfc04fe7759e8039bfb6a331220e01f494'
AND (
token = 'K6BZOfLYG1BG/UKhjhgAGFWq9sgSnvS1sYEBi2qk81U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)