UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wrQkPRaHmkWfQ/5D22kE7kXkJ27QKmJOwl9pbVwVP/I='
WHERE
key_id = 'dd1a2b053f30fd68f7a6f9fe54ddf8f627a91ad2b613f38d87d5fcf257c1c41a'
AND (
token = 'wrQkPRaHmkWfQ/5D22kE7kXkJ27QKmJOwl9pbVwVP/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)