UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVJmBh/ozDjp832IG8rKiTqR/jR27vgfIz/Qf17GWTw='
WHERE
key_id = '736ac8c72c052ae384ef822fa38107532783870e03641a321f03d626a2a6ae01'
AND (
token = 'rVJmBh/ozDjp832IG8rKiTqR/jR27vgfIz/Qf17GWTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)