UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1lTxb0lElngKJEn0q3HLze0DD7EwIb4vEd90RlQVucg=' 
WHERE 
  key_id = 'e116b6a4d254fcd2110626e8fd08a1ebac5e40b916ac4f2b653165dd60de712f' 
  AND (
    token = '1lTxb0lElngKJEn0q3HLze0DD7EwIb4vEd90RlQVucg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041