UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GDgKn/GyW3SP149+S32OeD2YI6dOUpT8l2ohIIJxOes=' 
WHERE 
  key_id = '3ea12d17011bff1c27d6e741ab3a9c8b349595d851e4c8a49dcfddb357abe2ce' 
  AND (
    token = 'GDgKn/GyW3SP149+S32OeD2YI6dOUpT8l2ohIIJxOes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028