UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Sot2E7Qh5Lu/a+OSzN/vr0DxX4slFbBPeox66M7xVo='
WHERE
key_id = '6c3bf3cd53e27b49d1889ba8ae01e775168994be3781c6c57e48dd4017cb7e8d'
AND (
token = '3Sot2E7Qh5Lu/a+OSzN/vr0DxX4slFbBPeox66M7xVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)