UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B94JgqMLcQ3i0VDy7ABQyxEgREEQ0zkMPibQ9Sf2Ka4=' 
WHERE 
  key_id = '727759d4dfcb8881bba91c0af4f12c05411a04db6f69c0974afe49d95e4b119c' 
  AND (
    token = 'B94JgqMLcQ3i0VDy7ABQyxEgREEQ0zkMPibQ9Sf2Ka4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027