UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Fm5jChj0FR6lw31chUftfi24LCdS8L7eRw8A176hrQ='
WHERE
key_id = 'e3e915b6631d35e351f6776f39933b089eafc3a7811fe1185b2d4bf3d4144484'
AND (
token = '1Fm5jChj0FR6lw31chUftfi24LCdS8L7eRw8A176hrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)