UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qZt2G/yC/G1q2oeL8hqyAv9qA1dUcUvuX+bJgKtdfDE='
WHERE
key_id = '6db120f1b5b37e632b6a2b68a99d271c66b0c4fd59176acb3c5a3a8db6a62391'
AND (
token = 'qZt2G/yC/G1q2oeL8hqyAv9qA1dUcUvuX+bJgKtdfDE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)