UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KiB/sUIbzkH3mhqZQ/s1Gjd8Xn63zZ/v35Baf67ZlQ='
WHERE
key_id = 'a298bfcd3d005cc757f5727ad6f842adfe63940c1e0fe8571a833174e5b9a208'
AND (
token = '4KiB/sUIbzkH3mhqZQ/s1Gjd8Xn63zZ/v35Baf67ZlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)