UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mchn0jsuTs0VxDZmDD2w7fe8vtTULk8Uq8Lr+DaqANI=' 
WHERE 
  key_id = 'b8ccca04ee16417574a1211366a8131b77264de5437425e95f38195f34048995' 
  AND (
    token = 'Mchn0jsuTs0VxDZmDD2w7fe8vtTULk8Uq8Lr+DaqANI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017