UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5thsikG7MxzoMK0E1CS+Vvg8zOjklUZUQ7lLzH2qq2s='
WHERE
key_id = '350c2437b3b0501980d375ec915ceed20f14e77fa6658c3649aff0896eb79f4a'
AND (
token = '5thsikG7MxzoMK0E1CS+Vvg8zOjklUZUQ7lLzH2qq2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)