UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aCGC5XkerOeMgeycMSBW2wejNFz5baV6/d8Om9SMXyM='
WHERE
key_id = '63d29703e983858a9c1bae369a13789db32db42c278da7660953e9193cc76464'
AND (
token = 'aCGC5XkerOeMgeycMSBW2wejNFz5baV6/d8Om9SMXyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)