UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yPDul80V6HlCDmcy/Kjqzx9ukw9GSgHzpUnibxTJZBI='
WHERE
key_id = 'a3b345cc03369ee6663f995bdc4209d77a8dec5be6955fa7d5958cb5ee08d028'
AND (
token = 'yPDul80V6HlCDmcy/Kjqzx9ukw9GSgHzpUnibxTJZBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)