UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDyr6cNghJFeq8VW77MNrqmWLkxPF/SzzuHzaPoZGJA='
WHERE
key_id = '0023457cabc9be52bdde929b06661210d83c102b6466abbc66a0139df786f5bd'
AND (
token = 'iDyr6cNghJFeq8VW77MNrqmWLkxPF/SzzuHzaPoZGJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)