UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'woU90q+68WL5mAK5gHeSUcvW8OjEujwKYkKnfmqsmLI=' 
WHERE 
  key_id = 'd36b4faa9ba9ef8e45797f8fc8834265c1dfaf0dbcea4dd94d94cb0941d778e9' 
  AND (
    token = 'woU90q+68WL5mAK5gHeSUcvW8OjEujwKYkKnfmqsmLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040