UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '90MnmQXpPB7AV6o1rcIQAJj+5Vw1qKV/cqjpFIFNHW8='
WHERE
key_id = '5ce6cd86b1f3672cb93378ce64a7c4884671cab33715b7c4ec9b3af7cb28be66'
AND (
token = '90MnmQXpPB7AV6o1rcIQAJj+5Vw1qKV/cqjpFIFNHW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)