UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0LAYSQO3iJOKTq4t20y26CN3Ql+l/2h/Llcj8SLVgzk=' 
WHERE 
  key_id = '99ff235ef932c66ab53083b197c58d151bcdc35f360ff9a4a81a739bd320b226' 
  AND (
    token = '0LAYSQO3iJOKTq4t20y26CN3Ql+l/2h/Llcj8SLVgzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033