UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'blT+5WBZ9OqewyS93wCQnCDVuz7B8FIhS3EdbJS4d2Y='
WHERE
key_id = '307348ed53e6931c1fe1ca4f174cf6363efcb92479eaa5f8d0e964e2012b084d'
AND (
token = 'blT+5WBZ9OqewyS93wCQnCDVuz7B8FIhS3EdbJS4d2Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)