UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I06dLBmTrpispYsNlbo35sG7w9X7I2YfVmjpUWMNFig='
WHERE
key_id = 'd70ca6d560460e5e4fc8b9efd35ee08c8d9c02b6027b716195a6a97077bb5d8b'
AND (
token = 'I06dLBmTrpispYsNlbo35sG7w9X7I2YfVmjpUWMNFig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)