UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3X+Ax1ziido6XRGrMUEYiVA8Vf5YNWdjHV+N/mnIiI='
WHERE
key_id = '5c26c8a4cbddeadca594e2c2a0a50d0e58adb60dada622d587528543c147ba5c'
AND (
token = 'X3X+Ax1ziido6XRGrMUEYiVA8Vf5YNWdjHV+N/mnIiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)